//package com.applink.sell_proof.fragment;
//
//import android.database.Cursor;
//import android.graphics.Color;
//import android.os.Bundle;
//import android.support.v4.app.LoaderManager.LoaderCallbacks;
//import android.support.v4.content.CursorLoader;
//import android.support.v4.content.Loader;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.ViewGroup;
//import android.widget.AdapterView;
//import android.widget.AdapterView.OnItemSelectedListener;
//import android.widget.ArrayAdapter;
//import android.widget.ExpandableListView;
//import android.widget.ListView;
//import android.widget.ExpandableListView.OnChildClickListener;
//import android.widget.Spinner;
//import android.widget.TextView;
//import com.actionbarsherlock.app.SherlockFragment;
//import com.applink.sell_proof.BasePagerActivity;
//import com.applink.sell_proof.R;
//import com.applink.sell_proof.constant.Constant;
//import com.applink.sell_proof.database.EMarketingContentProvider;
//import com.applink.sell_proof.database.table.RewardDBHelper;
//
//public class NewRewardCatalogFragment extends SherlockFragment implements LoaderCallbacks<Cursor>,OnChildClickListener, OnItemSelectedListener{
////	protected ViewGroup mLayout;
////	private int mReferenceLoading = 2;
////	private View	mHeaderReward;
////	
////	@Override
////	public View onCreateView(LayoutInflater inflater, ViewGroup container,
////			Bundle savedInstanceState) {
////		if(mLayout == null){
////			mLayout = (ViewGroup) inflater.inflate(R.layout.reward_catelog, null, false);
////		}
////		mHeaderReward = inflater.inflate(R.layout.header_reward_catalog, null);
////		((ListView)mLayout.findViewById(android.R.id.list)).addHeaderView(mHeaderReward,null,false);
////		ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
////				getActivity(), R.array.reward, android.R.layout.simple_spinner_item);
////		
////		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
////		((Spinner)mLayout.findViewById(R.id.spinner_program)).setOnItemSelectedListener(this);
////		((Spinner)mLayout.findViewById(R.id.spinner_program)).setAdapter(adapter);
////		((Spinner)mLayout.findViewById(R.id.spinner_program)).setSelection(0);
////		
////		//spin.setOnItemSelectedListener(this);
////		
////		//spin.setAdapter(adapter);
////		init();
////		setHasOptionsMenu(true);
////		((BasePagerActivity)getActivity()).showProgressDialog(R.id.reward_statement_container_loading);
////		return mLayout;
////	}
////	
////	@Override
////	public void onResume() {
////		super.onResume();
//////		DataHelper.getInstance().addObserver(this);
//////		mReferenceLoading = 2;
////	}
////	
////	
////	@Override
////	public void onActivityCreated(Bundle savedInstanceState) {
////		super.onActivityCreated(savedInstanceState);
////		getActivity().getSupportLoaderManager().initLoader(0, null, this);
////	}
////
//////	@Override
//////	public void update(Observable observable, Object data) {
//////		mReferenceLoading--;
//////		if(mReferenceLoading == 0) ((BasePagerActivity)getActivity()).hideProgressDialog(R.id.reward_statement_container_loading);
//////		ListView listview = ((ListView)mLayout.findViewById(android.R.id.list));
//////		listview.setVisibility(View.VISIBLE);
//////	}
////	
////	public void init(){	
////		ListView listview = ((ListView)mLayout.findViewById(android.R.id.list));
////		listview.setVisibility(View.VISIBLE);
////		((BasePagerActivity)getActivity()).hideProgressDialog(R.id.reward_statement_container_loading);
////		Constant.dataReward = RewardDBHelper.getAllReward();
////		if(Constant.dataReward == null){
////			return;
////		}
////		//RewardCatalogAdapter adapter = new RewardCatalogAdapter(0,Constant.dataReward);
////		listview.setAdapter(adapter);
////		//((ListView)mLayout.findViewById(android.R.id.list)).setAdapter(adapter);
////	}
////
////	@Override
////	public Loader<Cursor> onCreateLoader(int arg0, Bundle arg1) {
////		return new CursorLoader(getActivity(), EMarketingContentProvider.REDEEM_CONTENT_URI, null, null, null, null);
////	}
////
////	@Override
////	public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
////		if(cursor != null && loader.getId() == 0){
////
////		}
////		
////	}
////
////	@Override
////	public void onLoaderReset(Loader<Cursor> arg0) {
////		// TODO Auto-generated method stub
////		
////	}
////
////	
////
////	@Override
////	public boolean onChildClick(ExpandableListView parent, View v,
////			int groupPosition, int childPosition, long id) {
//////		if(groupPosition == 0){
//////			Redeem redeem =(Redeem)parent.getExpandableListAdapter().getChild(groupPosition, childPosition);
////
//////		}
////		return false;
////	}
////	
////	@Override
////	public void onPause() {
////		super.onPause();
////		//DataHelper.getInstance().deleteObserver(this);
////	}
////
////	@Override
////	public void onItemSelected(AdapterView<?> arg0, View arg1, int postion,
////			long id) {
////		ListView listview = ((ListView)mLayout.findViewById(android.R.id.list));
////		listview.setVisibility(View.VISIBLE);
////		((TextView) arg0.getChildAt(0)).setTextColor(Color.BLACK);
////		if(Constant.dataReward == null){
////			return;
////		}else{
////			RewardCatalogAdapter adapter = new RewardCatalogAdapter(postion,Constant.dataReward);
////			listview.setAdapter(adapter);
////			//((ListView)mLayout.findViewById(android.R.id.list)).setAdapter(adapter);
////		}				
////	}
////
////	@Override
////	public void onNothingSelected(AdapterView<?> arg0) {
////		// TODO Auto-generated method stub
////		
////	}
//}
